//
//  TKYSafetyCell.m
//  StationHouseHelper
//
//  Created by apple on 2018/7/9.
//  Copyright © 2018年 铁科院. All rights reserved.
//

#import "TKYSafetyCell.h"
@interface TKYSafetyCell()

@property (nonatomic, strong)UIView *super_view;

@property (nonatomic, strong)UIImageView *imageV;
@property (nonatomic, strong)UILabel *questionLabel;
@property (nonatomic, strong)UILabel *startPersonLabel;
//@property (nonatomic, strong)UILabel *startDateLabel;



@end
@implementation TKYSafetyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.imageV];
        [self.contentView addSubview:self.questionLabel];
        [self.contentView addSubview:self.startPersonLabel];
        [self.contentView addSubview:self.startDateLabel];
        
        [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).with.offset(kWidthScale *15);
            make.top.equalTo(self.contentView).with.offset(kWidthScale *15);
            make.height.mas_equalTo(kHeightScale *85);
            make.width.mas_equalTo(self.imageV.mas_height);
        }];
        
        [self.questionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.imageV.mas_top);
            make.left.equalTo(self.imageV.mas_right).with.offset(kWidthScale *5);
            make.right.mas_equalTo(self.contentView).with.offset(kWidthScale *10);
            make.height.mas_equalTo(kHeightScale *25);
        }];
        
        [self.startPersonLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.questionLabel.mas_bottom).with.offset(kHeightScale *0);
            make.left.equalTo(self.questionLabel.mas_left);
            make.height.mas_equalTo(kHeightScale *25);
            make.right.mas_equalTo(self.contentView).with.offset(kWidthScale *10);
        }];
        
        [self.startDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.startPersonLabel.mas_bottom).with.offset(kHeightScale *0);
            make.left.equalTo(self.startPersonLabel.mas_left);
            make.bottom.mas_equalTo(self.imageV.mas_bottom);
            make.height.mas_equalTo(kHeightScale *25);
            make.right.mas_equalTo(self.contentView).with.offset(kWidthScale *10);
        }];
    }
    return self;
}

-(void)setFrame:(CGRect)frame{
    frame.origin.x += 10;
    frame.origin.y += 5;
    frame.size.height -= 5;
    frame.size.width -= 20;
    [self tky_cornerWithRadius:3 borderColor:kMainColour borderWidth:0.5];
    self.backgroundColor = kRGBColor(254, 254, 254, 1);
    [super setFrame:frame];
}

- (UIImageView *)imageV{
    if (_imageV == nil) {
        _imageV = [[UIImageView alloc]init];
        _imageV.backgroundColor = KrandomColor;
       [_imageV tky_cornerWithRadius:5 borderColor:nil borderWidth:0];
    }
    return _imageV;
}

- (UILabel *)questionLabel{
    if (_questionLabel == nil) {
        _questionLabel = [[UILabel alloc]init];
        _questionLabel.font = Font(12);
        _questionLabel.text = @"质量问题:进度";
    }
    return _questionLabel;
}

- (UILabel *)startPersonLabel{
    if (_startPersonLabel == nil) {
        _startPersonLabel = [[UILabel alloc]init];
        _startPersonLabel.font = Font(12);
        _startPersonLabel.text = @"发起人:张某某";
    }
    return _startPersonLabel;
}

- (UILabel *)startDateLabel{
    if (_startDateLabel == nil) {
        _startDateLabel = [[UILabel alloc]init];
        _startDateLabel.font = Font(12);
        _startDateLabel.text = @"发起日期:2018-3-3";
    }
    return _startDateLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
